<template>
  <div class="dashboard-editor-container">
  <el-row>
    <h1 style="text-align: center;ont-size:bold;font-size:  30px;background-color:white;">志愿者管理系统数据展示</h1>
  </el-row>
    <el-row :gutter="32">
      <el-col :xs="12" :sm="12" :lg="8">
        <div class="chart-wrapper">
          <event-chart />
        </div>
      </el-col>
      <el-col :xs="12" :sm="12" :lg="8">
        <div class="chart-wrapper">
          <check-chart />
        </div>
      </el-col>
      <el-col :xs="12" :sm="12" :lg="8">
        <div class="chart-wrapper">
          <audit-chart />
        </div>
      </el-col>
    </el-row>
    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <day-chart :chart-data="ChartData"/>
    </el-row>
  </div>
</template>

<script>
import eventChart from "@/views/dashboard/eventChart";
import checkChart from "@/views/dashboard/checkChart";
import auditChart from "@/views/dashboard/auditChart";
import DayChart from "@/views/dashboard/dayChart";
import dayChart from "@/views/dashboard/dayChart";
import {getdayEvent} from "@/api/volunteer/event";

const ChartData = {
  new: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 82, 91, 154, 162, 140, 145]
  }
}

export default {
  name: "Index",
  data() {
    return {
     ChartData: ChartData.new,
      nowdayEventNum:null
    };
  },

  components:{
    DayChart,
    eventChart,
    checkChart,
    auditChart,
    dayChart
  },
  mounted() {
    getdayEvent().then((response)=>{
      this.nearlyDay=response.rows.map((obj)=>{return obj.sdata})
      this.nowdayEventNum=response.rows.map((obj)=> {return obj.eventNum})
    })
  },
}
</script>

<style scoped lang="scss">
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>

